
package ch.hearc.coursJava.moo.thread.addition;

public class UseAdditionThreadV2
	{

	/*------------------------------------------------------------------*\
	|*							Methodes Public							*|
	\*------------------------------------------------------------------*/

	public static void main(String[] args)
		{
		main();
		}

	public static void main()
		{
		int x = 5;
		int y = 10;

		RunnableAddition runnable = new RunnableAddition(x, y);

		Thread t1 = new Thread(runnable);
		t1.start();
		//join(t1); // attend la fin de t1

		int resultat = runnable.getResultat();
		System.out.println(resultat);
		}

	/*------------------------------------------------------------------*\
	|*							Methodes Private						*|
	\*------------------------------------------------------------------*/

	private static void join(Thread t)
		{
		try
			{
			t.join();
			}
		catch (InterruptedException e)
			{
			// TODO Auto-generated catch block
			e.printStackTrace();
			}
		}

	}
